package com.freight.core.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.freight.core.common.vo.SearchVo;
import com.freight.core.entity.Role;
import com.freight.core.entity.User;
import com.freight.core.entity.UserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @describe x
 */
public interface UserRoleMapper extends BaseMapper<UserRole> {

    List<Role> getAllListHome();

    Page<User> getUserByCondition(@Param("user") User user,
                                  @Param("searchVo") SearchVo searchVo, Page<User> page);

    /**
     * 通过用户id获取
     * @param userId
     * @return
     */
    List<Role> findByUserId(@Param("userId") Long userId);

    /**
     * 通过用户id获取用户角色关联的部门数据
     * @param userId
     * @return
     */
    List<Long> findDepIdsByUserId(@Param("userId") Long userId);

    /**
     * 获取待审核用户
     * @return
     */
    List<User> getPendingUser();

    String signUserId(@Param("userId") Long userId);
}
